home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Gold Medal Software 3
/
Gold Medal Software - Volume 3 (Gold Medal) (1994).iso
/
windows
/
editprog
/
newvisda.arj
/
JOIN.FRM
< prev
next >
Wrap
Text File
|
1994-03-27
|
5KB
|
187 lines
VERSION 2.00
Begin Form fJoin
BackColor = &H00C0C0C0&
BorderStyle = 1 'Fixed Single
Caption = "Join Tables"
ClientHeight = 1935
ClientLeft = 3510
ClientTop = 1935
ClientWidth = 5835
ControlBox = 0 'False
Height = 2400
Left = 3420
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 1935
ScaleWidth = 5835
Top = 1560
Width = 6015
Begin CommandButton ClearJoinsButton
BackColor = &H00C0C0C0&
Caption = "C&lear All Joins"
Height = 372
Left = 2040
TabIndex = 7
Top = 1440
Width = 1812
End
Begin CommandButton CloseButton
BackColor = &H00C0C0C0&
Cancel = -1 'True
Caption = "&Close"
Height = 372
Left = 3960
TabIndex = 6
Top = 1470
Width = 1812
End
Begin ListBox cFieldList2
BackColor = &H00FFFFFF&
Height = 1200
Left = 3960
TabIndex = 4
Tag = "OL"
Top = 240
Width = 1815
End
Begin ListBox cFieldList1
BackColor = &H00FFFFFF&
Height = 1200
Left = 2040
TabIndex = 3
Tag = "OL"
Top = 240
Width = 1815
End
Begin CommandButton AddJoinButton
BackColor = &H00C0C0C0&
Caption = "&Add Join to Query"
Enabled = 0 'False
Height = 372
Left = 120
TabIndex = 1
Top = 1440
Width = 1812
End
Begin ListBox cTableList
BackColor = &H00FFFFFF&
Height = 1200
Left = 120
MultiSelect = 1 'Simple
TabIndex = 0
Tag = "OL"
Top = 240
Width = 1815
End
Begin Label FieldsLabel
Alignment = 2 'Center
BackColor = &H00C0C0C0&
Caption = "Select Fields to Join Selected Tables on:"
Height = 192
Left = 2040
TabIndex = 5
Top = 0
Width = 3732
End
Begin Label TableListLabel
BackColor = &H00C0C0C0&
Caption = "Select Table Pair:"
Height = 192
Left = 120
TabIndex = 2
Top = 0
Width = 1812
End
End
Option Explicit
Dim FTbl1 As String
Dim FTbl2 As String
Sub AddJoinButton_Click ()
Dim i As Integer
'SELECT DISTINCTROW Categories.[Category Name], Categories.Description, Products.[Product Name], Products.[English Name]
'FROM Categories, Products,
'Categories INNER JOIN Products ON Categories.[Category ID] = Products.[Category ID];
fQuery.cJoinFields.AddItem FTbl1 + "." + "[" + cFieldList1 + "]" + "=" + FTbl2 + "." + "[" + cFieldList2 + "]"
For i = 0 To cTableList.ListCount - 1
cTableList.Selected(i) = False
Next
End Sub
Sub cFieldList1_Click ()
If cFieldList2 <> "" Then
AddJoinButton.Enabled = True
End If
End Sub
Sub cFieldList2_Click ()
If cFieldList1 <> "" Then
AddJoinButton.Enabled = True
End If
End Sub
Sub ClearJoinsButton_Click ()
fQuery.cJoinFields.Clear
End Sub
Sub CloseButton_Click ()
Unload Me
End Sub
Sub cTableList_Click ()
Dim i As Integer
Dim t As TableDef
FTbl1 = ""
FTbl2 = ""
cFieldList1.Clear
cFieldList2.Clear
For i = 0 To cTableList.ListCount - 1
If cTableList.Selected(i) Then
If FTbl1 = "" Then
FTbl1 = cTableList.List(i)
Else
FTbl2 = cTableList.List(i)
Exit For
End If
End If
Next
If FTbl2 = "" Then Exit Sub 'only one table selected
Set t = gCurrentDB.TableDefs(FTbl1)
For i = 0 To t.Fields.Count - 1
cFieldList1.AddItem t.Fields(i).Name
Next
Set t = gCurrentDB.TableDefs(FTbl2)
For i = 0 To t.Fields.Count - 1
cFieldList2.AddItem t.Fields(i).Name
Next
End Sub
Sub Form_Load ()
Dim i As Integer
For i = 0 To fQuery.cTableList.ListCount - 1
If fQuery.cTableList.Selected(i) Then
cTableList.AddItem fQuery.cTableList.List(i)
End If
Next
Top = VDMDI.Top + fQuery.Top + fQuery.cCriteria.Top + 1300
Left = fQuery.Left + 1500
End Sub
Sub Form_Paint ()
Outlines Me
End Sub